import turtle
import random


# 画一个能够填充随机颜色的三角形
def star():
    turtle.clear()
    r = random.randint(0, 255)
    g = random.randint(0, 255)
    b = random.randint(0, 255)
    turtle.color((r,g,b))
    turtle.begin_fill()
    for i in range(5):
        turtle.forward(100)
        turtle.right(144)
    turtle.end_fill()
    turtle.ontimer(star, 500)

turtle.colormode(255)
turtle.tracer(False)
star()
turtle.done()

